//
//
//

#include "xlispqt.h"
#include <QMessageBox>

#include <iostream>

xlispqt::MainWindow::MainWindow()
{
	ui.setupUi(this);

	setCentralWidget(ui.plainTextEdit);
	connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(close()));
	connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(about()));
	connect(ui.plainTextEdit->document(), SIGNAL(contentsChanged()), this, SLOT(documentWasModified()));
	connect(ui.plainTextEdit, SIGNAL(quitRequest(int)), this, SLOT(close()));

	ui.plainTextEdit->init(QCoreApplication::argc(), QCoreApplication::argv()); // initialize lisp engine
}

xlispqt::MainWindow::~MainWindow()
{
}

void
xlispqt::MainWindow::documentWasModified()
{
	setWindowModified(ui.plainTextEdit->document()->isModified());
}

void
xlispqt::MainWindow::about()
{
   QMessageBox::about(this, tr("About xlispqt"),
            tr("The <b>xlispqt</b> ..."));
}

